#!/usr/bin/env sh

# 确保脚本抛出遇到的错误
set -e

# 生成静态文件
yarn build

# 进入生成的文件夹
cd dist

# 如果是发布到自定义域名
# echo 'www.example.com' > CNAME

git init
git add -A
git commit -m "@deploy | $(date +'%Y-%m-%d %H:%M:%S')"
git remote add origin git@gitee.com:tvshop/vuedist.git
echo "$(date +'%Y-%m-%d %H:%M:%S')|开始到生产环境部署"
git push -f origin master
echo "$(date +'%Y-%m-%d %H:%M:%S')|完成到生产环境部署"

#open -a "/Applications/Safari.app" https://gitee.com/gcslaoli/gcslaoli/pages 

cd -